{include file="admin/top.php" subject='purchases'}
{include file="purchases/top.php" subject='purchases'}
<script>
var action = 'orderProduct', productsData = null;	
</script>
<script src="{$module_path}scripts/modify_purchases.js" type="text/javascript"></script>
<div id="content">
<ul id="addmenu"><li style="text-align: right;"><a href="javascript:void(0);" style="font-size:16px;font-weight:bold;" onclick="javascript:window.parent.iframe_form('sendprint', '采购单打印', '/admin/module.php?m=logistics&s=print.php&type=purchasePrint&{$print_param}', 850,500);" act="show">打印</a></li></ul>
    <div id="boxquery">
    <form method="get">
    <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="purchases.php" />
        <input type="hidden" name="uri" value="orderProducts" />
        <input type="submit" value="查询" class="fr" />
        <li>
			仓库：
			<select class="easyui-combobox" style="width:110px" name="shopid" data-options="onSelect:selectedClass">
				{shops}<option value="{$shops.id}" {if $smarty.get.shopid==$shops.id}selected{/if}>{$shops.title}</option>{/shops}
			</select>
		</li>
		<li>
			类型：
			<select class="easyui-combobox" style="width:110px" name="listType" data-options="onSelect:selectedClass">
				<option value="1" {if $smarty.get.listType==1}selected{/if}>备货采购</option>
				<option value="2" {if $smarty.get.listType==2}selected{/if}>订单采购</option>
			</select>
		</li>
        <li class="yui-skin-sam">时间:&nbsp; 
            <input id="sdate" name="sdate" type="text" size="12" value="{$smarty.get.sdate}" onfocus="lockinput(this)" />
            <input id="edate" name="edate" type="text" size="12" value="{$smarty.get.edate|default:$smarty.now|date_format:'%Y-%m-%d'}" onfocus="lockinput(this)" />
            <div id="calContainer" style="display:none; position:absolute;"></div>
        </li>
<!--         <li>供应商:&nbsp; -->
<!--         <input name="supplier" type="text" id="supplier" value="{$smarty.get.supplier}" size="16" onclick="select()" oninput="context_menu_suppliers(this, 'supplierid=[id],supplier=[title]')" onfocus="context_menu_suppliers(this, 'supplierid=[id],supplier=[title]')" />-->
<!--         <input name="supplierid" type="hidden" id="supplierid" value="{$smarty.get.supplierid}" size="16" /> -->
<!--         </li> -->
        <li>
			供货商负责人：
			<select class="easyui-combobox" style="width:110px" name="classid" id="classid" data-options="onSelect:selectedClass">
				<option value="0">不限</option>
				{classes}<option value="{$classes.id}" {if $smarty.get.classid==$classes.id}selected{/if}>{$classes.title}</option>{/classes}
			</select>
		</li>
		<li>
			供货商：
			<select class="easyui-combobox" style="width:350px" name="supplierid" id="supplierid" data-options="valueField: 'id',textField: 'title',onSelect:selectedSupplier,onLoadSuccess:loadSuppliersSuccess" url="/admin/module.php?m=inventory&s=purchases.php&uri=getSupplies&classid=0">
			</select>
		</li>
    </form>
    </div>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="lister">
      <tr id="title">
        <td width="40">商品ID</td>
        <td>商品图片</td>
        <td>商品名称</td>
        <td>商品规格</td>
        <td>商品单位</td>
        <td>采购单价</td>
        <td>货币单位</td>
        <td>订单采购</td>
        <td>微仓采购</td>
        <td>预警采购</td>
        <td>采购数量</td>
        <td>操作</td>
      </tr>
      {foreach item=item from=$list.rows}
      <tr id="content">
        <td>{$item.pid}</td>
        <td>{$item.pic}</td>
        <td>{$item.pname}</td>
        <td>{$item.spec}</td>
        <td>个</td>
        <td>{$item.cost_price}</td>
        <td>{$item.currency_unit}</td>
        <td>{$item.order_num*1}</td>
        <td>{$item.microStockNum}</td>
        <td>{$item.warningNum}</td>
        <td>{$item.number}</td>
        <td><button class="history_button" productid="{$item.id}" shopid="{$smarty.get.shopid}">历史采购</button></td>
      </tr>
      {/foreach}
    </table>
        <div id="pager" class="mt10">
        共{$list.total}条记录		
	</div>
</div>
{include file="admin/bottom.php"}
</body>
</html>
